package com.gscitysfy.cus.drain.modules.duty.entity;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;

import com.gscitysfy.cus.drain.utils.DateUtil;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.util.Date;
import java.util.Objects;

/**
 * @author syge
 * @since 2022-04-07 15:20:40
 */
@Getter
@Setter
@EqualsAndHashCode
public class MoperDutyMnExchangeExcel implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @ExcelIgnore
    private Long coamKid;

    /**
     * 调换班类型(0:调班 1:替班)
     */
    @ExcelIgnore
    private Integer coamExchangeType;

    @ExcelProperty("调换类型")
    private String coamExchangeTypeDesc;

    public void setCoamExchangeType(Integer coamExchangeType) {
        this.coamExchangeType = coamExchangeType;
        if (Objects.isNull(coamExchangeType)){
            return;
        }
        if(coamExchangeType.equals(0)){
            this.coamExchangeTypeDesc = "调班";
        }
        if(coamExchangeType.equals(1)){
            this.coamExchangeTypeDesc = "替班";
        }
    }

    /**
     * 值班日期
     */
    @ExcelIgnore
    private Date coamDutyDate;


    /**
     * 值班日期
     */
    @ExcelProperty("值班日期")
    private String coamDutyDateStr;

    public void setCoamDutyDate(Date coamDutyDate) {
        this.coamDutyDateStr = DateUtil.dateToDateString(coamDutyDate,"yyyy-MM-dd");
        this.coamDutyDate = coamDutyDate;
    }

    /**
     * 值班班次名称
     */
    @ExcelProperty("值班班次")
    private String coamDutyClasses;

    /**
     * 值班人id
     */
    @ExcelIgnore
    private Long coamDutyPerson;

    /**
     * 值班人名称
     */
    @ExcelProperty("值班人员")
    private String coamDutyPersonDesc;

    /**
     * 调换人id
     */
    @ExcelIgnore
    private Long coamExchangePerson;

    /**
     * 调换人名称
     */
    @ExcelProperty("调/替人")
    private String coamExchangePersonDesc;

    /**
     * 调换日期(替班类型 这个值应为空)
     */
    @ExcelIgnore
    private Date coamExchangeDate;

    /**
     * 调换日期(替班类型 这个值应为空)
     */
    @ExcelProperty("调班日期")
    private String coamExchangeDateStr;

    public void setCoamExchangeDate(Date coamExchangeDate) {
        if(null != coamExchangeDate)
        this.coamExchangeDateStr = DateUtil.dateToDateString(coamExchangeDate,"yyyy-MM-dd");
        this.coamExchangeDate = coamExchangeDate;
    }

    /**
     * 操作人员
     */
    @ExcelProperty("操作人员")
    private String coamOperatePerson;

    /**
     * 操作时间
     */
    @ExcelProperty("操作时间")
    private Date coamOperateDate;

    /**
     * 调换班说明
     */
    @ExcelProperty("替换班说明")
    private String coamExchangeNote;

    /**
     * 数据添加时间	
     */
    @ExcelIgnore
    private Date coamAddtime;

    /**
     * 数据修改时间
     */
    @ExcelIgnore
    private Date coamUptime;

    /**
     * 添加人
     */
    @ExcelIgnore
    private String coamCreator;

    /**
     * 修改人
     */
    @ExcelIgnore
    private String coamModifier;

    /**
     * 数据状态，1表示删除
     */
    @ExcelIgnore
    private Integer coamUsable;

    /**
     * 值班班次名称(替班类型 这个值应为空)
     */
    @ExcelProperty("调班班次")
    private String coamExchangeClasses;

    /**
     * 调班记录状态，0草稿，1审核通过，2审核不通过
     */
    @ExcelIgnore
    private Integer coamExchangeStatus;


    public void setCoamExchangeStatus(Integer coamExchangeStatus) {
        this.coamExchangeStatus = coamExchangeStatus;
        if(Objects.isNull(coamExchangeStatus)){
            return;
        }
        if(coamExchangeStatus.intValue() == 0){
            this.coamExchangeStatusDesc = "草稿";
        }
        if(coamExchangeStatus.intValue() == 1){
            this.coamExchangeStatusDesc = "通过";
        }
        if(coamExchangeStatus.intValue() == 2){
            this.coamExchangeStatusDesc = "退回";
        }
        if(coamExchangeStatus.intValue() == 3){
            this.coamExchangeStatusDesc = "已提交";
        }
    }

    /**
     * 调班记录状态，0草稿，1审核通过，2审核不通过
     */
    @ExcelProperty("状态")
    private String coamExchangeStatusDesc;

    /**
     * 审核意见
     */
    @ExcelProperty("审核意见")
    private String coamExamineComments;

    /**
     * 值班人电话
     */
    @ExcelProperty("值班人联系电话")
    private String coamDutyContactNumber;

    /**
     * 替换人电话
     */
    @ExcelProperty("调/替人联系电话")
    private String coamExchangeContactNumber;
}
